package com.mrx.xfriendship.dao;

import com.mrx.xfriendship.model.dto.PostCountDTO;
import com.mrx.xfriendship.model.po.PostPO;
import com.mrx.xfriendship.model.vo.ListPostPageVO;
import com.mrx.xfriendship.model.vo.PostManagePageVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Mr.X
 * @since 2023-01-14 10:50:30
 */
@Mapper
public interface PostMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(PostPO record);

    int insertSelective(PostPO record);

    PostPO selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(PostPO record);

    int updateByPrimaryKey(PostPO record);

    List<PostPO> selectPage(ListPostPageVO vo);

    List<PostPO> selectPageCondition(PostManagePageVO vo);

    int addViewCount(Integer id);

    List<PostPO> selectByUserId(Integer userId);

    void updatePVWithIncrement(String postId, Integer increment);

    Integer countPostByTag(Integer tagId);

    Integer selectRank(Integer userId);

    List<PostCountDTO> selectPostCount();

    Integer selectPostNumByUserId(Integer userId);
}
